package org.csu.demo.nettydemo.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Objects;

@Data
@TableName("user")
public class User {

    public String id;
    public String nickname;
    public String password;

    public User(String id, String nickname) {
        super();
        this.id = id;
        this.nickname = nickname;
    }
    public User(String id, String nickname, String password) {
        super();
        this.id = id;
        this.nickname = nickname;
        this.password = password;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;
        User user = (User) o;
        return id.equals(user.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}

